import fetch from '@/api'
// 获取提单列表
export function getOutStockEntrust(params) {
    return fetch({
        method: 'get',
        url: `/pcOutStockEntrust`,
        params,
    })
}
// 获取提单详情
export function getOutStockEntrustDetail(entrustNo) {
    return fetch({
        method: 'get',
        url: `/pcOutStockEntrust/${entrustNo}`
    })
}
// 新增提单
export function addOutStockEntrust(data) {
    return fetch({
        method:'post',
        url:`/pcOutStockEntrust`,
        data,
    })
}

//入库类型
export function getInventoryType(type) {
    return fetch({
        method: 'get',
        url: `/inventory/find/inOrOut/enum/${type}`
    })
}
// 提单详情
export function getOutStockDetail(entrustNo) {
    return fetch({
        method:'get',
        url:`pcOutStockEntrust/${entrustNo}`
    })
}
//临单处理
export function outTempHandle(entrustNo,data) {
    return fetch({
        method:'put',
        url:`/pcOutStockEntrust/${entrustNo}/tempHandle`,
        data,
    })
}
//退为临单
export function outToTempHandle(entrustNo,data) {
    return fetch({
        method:'put',
        url:`pcOutStockEntrust/${entrustNo}/toTemp`,
        data,
    })
}
//受理
export function acceptStockEntrust(entrustNo) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/accept`
    })
}
// 删除
export function deleteStockEntrust(entrustNo) {
    return fetch({
        method:'delete',
        url:`/pcOutStockEntrust/${entrustNo}`,
    })
}
// 编辑
export function updateStockEntrust(entrustNo,data) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}`,
        data
    })
}
// 作废
export function voidStockEntrust(entrustNo) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/void`
    })
}
// 换票
export function changeStockEntrust(entrustNo,data) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/change`,
        data
    })
}
//审核
export function auditPassStockEntrust(entrustNo) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/auditPass`
    })
}
//审核butongguo
export function auditReturnStockEntrust(entrustNo,data) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/auditReturn`,
        data
    })
}
//复核
export function reviewPassStockEntrust(entrustNo) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/reviewPass`
    })
}
//复核退回
export function reviewReturnStockEntrust(entrustNo,data) {
    return fetch({
        method: 'put',
        url: `/pcOutStockEntrust/${entrustNo}/reviewReturn`,
        data
    })
}
// 出库单分页
export function getPcOutStockPlan(params) {
    return fetch({
        method: 'get',
        url: `/pcOutStockPlan`,
        params,
    })
}
// 出库单任务分页
export function getpcOutStockTask(params) {
    return fetch({
        method: 'get',
        url: `/pcOutStockTask`,
        params,
    })
}
// 出库单详情
export function getPcOutStockPlanDetail(entrustNo) {
    return fetch({
        method: 'get',
        url: `/pcOutStockPlan/${entrustNo}`
    })
}
// 出库单打印
export function printPcOutStockPlan(planNo) {
    return fetch({
        method: 'get',
        url: `/pcOutStockPlan/${planNo}/print`
    })
}
// 出库单作废
export function voidPcOutStockPlan(planNo) {
    return fetch({
        method: 'PUT',
        url: `/pcOutStockPlan/${planNo}/void`
    })
}
// 出库单提交
export function commitPcOutStockPlan(id, data) {
    return fetch({
        method: 'PUT',
        url: `/pcOutStockTask/${id}/commit`,
        data
    })
}
// 出库单确认
export function confirmStartPcOutStockPlan(id, data) {
    return fetch({
        method: 'PUT',
        url: `/pcOutStockTask/${id}/confirmStart`,
        data
    })
}
// 补录提货车辆
export function supplementCarOutStockPlan(entrustNo, data) {
    return fetch({
        method: 'PUT',
        url: `/pcOutStockEntrust/${entrustNo}/supplementCar`,
        data
    })
}

